import java.io.Serializable;
import java.util.ArrayList;

enum HouseType {WOOD, CLAY, STONE}
enum AnimalType {SHEEP, WILDBOAR, CATTLE}
enum PlantType {VEGETABLE, WHEAT}

public class FarmBoard extends Board implements Serializable {
	private FarmSlot slots[][] = new FarmSlot[5][3];
	protected Player player;
	private ArrayList<Cards.ImprovementCard> improvements;
	protected ArrayList<Pasture> pastures;
	protected int housecount, stablecount, fencecount;
	protected HouseType housetype;
	public FarmBoard(Player p) {
		player = p;
		improvements = new ArrayList<Cards.ImprovementCard>();
	}
	public void startround() {
		//improvements.startround();
	}
	public void harvest() {
		
	}
	public void addhouse(int x, int y) {
		slots[x][y].house = true;
	}
	public void upgradehouse() {
		if(housetype == HouseType.WOOD) {
			housetype = HouseType.CLAY;
		} else if(housetype == HouseType.CLAY) {
			housetype = HouseType.STONE;
		} else {
			//wtf
		}
	}
	public void addstable(int x, int y) {
		slots[x][y].stable = true;
		slots[x][y].pasture.stablecount++;
	}
	public void addanimal(int x, int y, AnimalType a, int count) {
		
	}
	public void removeanimal(int x, int y, int count) {
	
	}
	public void addpasture() {
		
	}
	public void addtopasture(FarmSlot f) {
		
	}
	public void plow(int x, int y) {
		slots[x][y].plowed = true;
	}
	public void sow(int x, int y, PlantType p) {
		
	}
	private class FarmSlot {
		protected boolean stable, plowed, house;
		protected Pasture pasture;
		protected PlantType planttype;
		protected AnimalType animaltype;
		protected int animalcount;
		public int animallimit() {
			if(pasture == null) {
				if(house == false && stable == false) {
					return 0;
				} else {
					return 1;
				}
			} else {
				return pasture.size * (int) Math.pow(2, pasture.stablecount);
			}
		}
	}
	private class Pasture {
		public int size;
		public int stablecount;
	}
}
